package com.jifeng.br.pjj.bookreader.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jifeng.br.pjj.bookreader.entity.BookEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 图书表 Mapper 接口
 * </p>
 *
 * @author 机蜂
 * @since 2023-07-11
 */
@Mapper
public interface BookMapper extends BaseMapper<BookEntity> {
    BookEntity getBookById(Integer bookId);

    List<BookEntity> getHotList();

    int updateScore(BookEntity book);

    IPage<BookEntity> getBookByCategoryId(@Param("page") IPage<BookEntity> page, @Param("categoryId") Integer categoryId);

    IPage<BookEntity> getBookByRecord(@Param("page") IPage<BookEntity> page, @Param("userId") Integer userId);

    IPage<BookEntity> getBookByLike(@Param("page") IPage<BookEntity> page, @Param("userId") Integer userId);
}
